<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE GeneralizedNewtypeDeriving #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-- | Hides away distracting bookkeeping while lambda lifting into a 'LiftM'</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- monad.</span><span>
</span><span id="line-7"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Stg.Lift.Monad</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-8"></span><span>    </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#decomposeStgBinding"><span class="hs-identifier">decomposeStgBinding</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#mkStgBinding"><span class="hs-identifier">mkStgBinding</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>    </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#Env"><span class="hs-identifier">Env</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>    </span><span class="annot"><span class="hs-comment">-- * #floats# Handling floats</span></span><span>
</span><span id="line-11"></span><span>    </span><span class="annot"><span class="hs-comment">-- $floats</span></span><span>
</span><span id="line-12"></span><span>    </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#FloatLang"><span class="hs-identifier">FloatLang</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#collectFloats"><span class="hs-identifier">collectFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- Exported just for the docs</span><span>
</span><span id="line-13"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Transformation monad</span></span><span>
</span><span id="line-14"></span><span>    </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier">LiftM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#runLiftM"><span class="hs-identifier">runLiftM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Adding bindings</span></span><span>
</span><span id="line-16"></span><span>    </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#startBindingGroup"><span class="hs-identifier">startBindingGroup</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#endBindingGroup"><span class="hs-identifier">endBindingGroup</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#addTopStringLit"><span class="hs-identifier">addTopStringLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#addLiftedBinding"><span class="hs-identifier">addLiftedBinding</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Substitution and binders</span></span><span>
</span><span id="line-18"></span><span>    </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#withSubstBndr"><span class="hs-identifier">withSubstBndr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#withSubstBndrs"><span class="hs-identifier">withSubstBndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#withLiftedBndr"><span class="hs-identifier">withLiftedBndr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#withLiftedBndrs"><span class="hs-identifier">withLiftedBndrs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Occurrences</span></span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#substOcc"><span class="hs-identifier">substOcc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#isLifted"><span class="hs-identifier">isLifted</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#formerFreeVars"><span class="hs-identifier">formerFreeVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#liftedIdsExpander"><span class="hs-identifier">liftedIdsExpander</span></a></span><span>
</span><span id="line-21"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html"><span class="hs-identifier">GHC.Types.CostCentre</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#isCurrentCCS"><span class="hs-identifier">isCurrentCCS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#dontCareCCS"><span class="hs-identifier">dontCareCCS</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html"><span class="hs-identifier">GHC.Data.OrdList</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Stg.Subst.html"><span class="hs-identifier">GHC.Stg.Subst</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html"><span class="hs-identifier">GHC.Stg.Syntax</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Arrow.html#"><span class="hs-identifier">Control.Arrow</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Control.Arrow.html#second"><span class="hs-identifier">second</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Class.html#"><span class="hs-identifier">Control.Monad.Trans.Class</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.RWS.Strict</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier">RWST</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier">runRWST</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.RWS.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">RWS</span></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Cont.html#"><span class="hs-identifier">Control.Monad.Trans.Cont</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Cont.html#ContT"><span class="hs-identifier">ContT</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-comment">-- | @uncurry 'mkStgBinding' . 'decomposeStgBinding' = id@</span><span>
</span><span id="line-52"></span><span id="local-6989586621680956947"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#decomposeStgBinding"><span class="hs-identifier hs-type">decomposeStgBinding</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#GenStgBinding"><span class="hs-identifier hs-type">GenStgBinding</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956947"><span class="hs-identifier hs-type">pass</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#RecFlag"><span class="hs-identifier hs-type">RecFlag</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#BinderP"><span class="hs-identifier hs-type">BinderP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956947"><span class="hs-identifier hs-type">pass</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#GenStgRhs"><span class="hs-identifier hs-type">GenStgRhs</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956947"><span class="hs-identifier hs-type">pass</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-53"></span><span id="decomposeStgBinding"><span class="annot"><span class="annottext">decomposeStgBinding :: forall (pass :: StgPass).
GenStgBinding pass -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
</span><a href="GHC.Stg.Lift.Monad.html#decomposeStgBinding"><span class="hs-identifier hs-var hs-var">decomposeStgBinding</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRec"><span class="hs-identifier hs-type">StgRec</span></a></span><span> </span><span id="local-6989586621680956694"><span class="annot"><span class="annottext">[(BinderP pass, GenStgRhs pass)]
</span><a href="#local-6989586621680956694"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(BinderP pass, GenStgRhs pass)]
</span><a href="#local-6989586621680956694"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#decomposeStgBinding"><span class="hs-identifier hs-var">decomposeStgBinding</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgNonRec"><span class="hs-identifier hs-type">StgNonRec</span></a></span><span> </span><span id="local-6989586621680956691"><span class="annot"><span class="annottext">BinderP pass
</span><a href="#local-6989586621680956691"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680956690"><span class="annot"><span class="annottext">GenStgRhs pass
</span><a href="#local-6989586621680956690"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">BinderP pass
</span><a href="#local-6989586621680956691"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenStgRhs pass
</span><a href="#local-6989586621680956690"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span id="local-6989586621680956941"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#mkStgBinding"><span class="hs-identifier hs-type">mkStgBinding</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RecFlag"><span class="hs-identifier hs-type">RecFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#BinderP"><span class="hs-identifier hs-type">BinderP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956941"><span class="hs-identifier hs-type">pass</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#GenStgRhs"><span class="hs-identifier hs-type">GenStgRhs</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956941"><span class="hs-identifier hs-type">pass</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#GenStgBinding"><span class="hs-identifier hs-type">GenStgBinding</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956941"><span class="hs-identifier hs-type">pass</span></a></span></span><span>
</span><span id="line-57"></span><span id="mkStgBinding"><span class="annot"><span class="annottext">mkStgBinding :: forall (pass :: StgPass).
RecFlag -&gt; [(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass
</span><a href="GHC.Stg.Lift.Monad.html#mkStgBinding"><span class="hs-identifier hs-var hs-var">mkStgBinding</span></a></span></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass
forall (pass :: StgPass).
[(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass
</span><a href="GHC.Stg.Syntax.html#StgRec"><span class="hs-identifier hs-var">StgRec</span></a></span><span>
</span><span id="line-58"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#mkStgBinding"><span class="hs-identifier hs-var">mkStgBinding</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(BinderP pass -&gt; GenStgRhs pass -&gt; GenStgBinding pass)
-&gt; (BinderP pass, GenStgRhs pass) -&gt; GenStgBinding pass
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="annot"><span class="annottext">BinderP pass -&gt; GenStgRhs pass -&gt; GenStgBinding pass
forall (pass :: StgPass).
BinderP pass -&gt; GenStgRhs pass -&gt; GenStgBinding pass
</span><a href="GHC.Stg.Syntax.html#StgNonRec"><span class="hs-identifier hs-var">StgNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">((BinderP pass, GenStgRhs pass) -&gt; GenStgBinding pass)
-&gt; ([(BinderP pass, GenStgRhs pass)]
    -&gt; (BinderP pass, GenStgRhs pass))
-&gt; [(BinderP pass, GenStgRhs pass)]
-&gt; GenStgBinding pass
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[(BinderP pass, GenStgRhs pass)] -&gt; (BinderP pass, GenStgRhs pass)
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-comment">-- | Environment threaded around in a scoped, @Reader@-like fashion.</span><span>
</span><span id="line-61"></span><span class="hs-keyword">data</span><span> </span><span id="Env"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#Env"><span class="hs-identifier hs-var">Env</span></a></span></span><span>
</span><span id="line-62"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Env"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#Env"><span class="hs-identifier hs-var">Env</span></a></span></span><span>
</span><span id="line-63"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="e_dflags"><span class="annot"><span class="annottext">Env -&gt; DynFlags
</span><a href="GHC.Stg.Lift.Monad.html#e_dflags"><span class="hs-identifier hs-var hs-var">e_dflags</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-64"></span><span>  </span><span class="hs-comment">-- ^ Read-only.</span><span>
</span><span id="line-65"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="e_subst"><span class="annot"><span class="annottext">Env -&gt; Subst
</span><a href="GHC.Stg.Lift.Monad.html#e_subst"><span class="hs-identifier hs-var hs-var">e_subst</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Stg.Subst.html#Subst"><span class="hs-identifier hs-type">Subst</span></a></span><span>
</span><span id="line-66"></span><span>  </span><span class="hs-comment">-- ^ We need to track the renamings of local 'InId's to their lifted 'OutId',</span><span>
</span><span id="line-67"></span><span>  </span><span class="hs-comment">-- because shadowing might make a closure's free variables unavailable at its</span><span>
</span><span id="line-68"></span><span>  </span><span class="hs-comment">-- call sites. Consider:</span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-comment">-- @</span><span>
</span><span id="line-70"></span><span>  </span><span class="hs-comment">--    let f y = x + y in let x = 4 in f x</span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-comment">-- @</span><span>
</span><span id="line-72"></span><span>  </span><span class="hs-comment">-- Here, @f@ can't be lifted to top-level, because its free variable @x@ isn't</span><span>
</span><span id="line-73"></span><span>  </span><span class="hs-comment">-- available at its call site.</span><span>
</span><span id="line-74"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="e_expansions"><span class="annot"><span class="annottext">Env -&gt; IdEnv DIdSet
</span><a href="GHC.Stg.Lift.Monad.html#e_expansions"><span class="hs-identifier hs-var hs-var">e_expansions</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Env.html#IdEnv"><span class="hs-identifier hs-type">IdEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span>  </span><span class="hs-comment">-- ^ Lifted 'Id's don't occur as free variables in any closure anymore, because</span><span>
</span><span id="line-76"></span><span>  </span><span class="hs-comment">-- they are bound at the top-level. Every occurrence must supply the formerly</span><span>
</span><span id="line-77"></span><span>  </span><span class="hs-comment">-- free variables of the lifted 'Id', so they in turn become free variables of</span><span>
</span><span id="line-78"></span><span>  </span><span class="hs-comment">-- the call sites. This environment tracks this expansion from lifted 'Id's to</span><span>
</span><span id="line-79"></span><span>  </span><span class="hs-comment">-- their free variables.</span><span>
</span><span id="line-80"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-81"></span><span>  </span><span class="hs-comment">-- 'InId's to 'OutId's.</span><span>
</span><span id="line-82"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-83"></span><span>  </span><span class="hs-comment">-- Invariant: 'Id's not present in this map won't be substituted.</span><span>
</span><span id="line-84"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#emptyEnv"><span class="hs-identifier hs-type">emptyEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#Env"><span class="hs-identifier hs-type">Env</span></a></span><span>
</span><span id="line-87"></span><span id="emptyEnv"><span class="annot"><span class="annottext">emptyEnv :: DynFlags -&gt; Env
</span><a href="GHC.Stg.Lift.Monad.html#emptyEnv"><span class="hs-identifier hs-var hs-var">emptyEnv</span></a></span></span><span> </span><span id="local-6989586621680956680"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680956680"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Subst -&gt; IdEnv DIdSet -&gt; Env
</span><a href="GHC.Stg.Lift.Monad.html#Env"><span class="hs-identifier hs-var">Env</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680956680"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Subst
</span><a href="GHC.Stg.Subst.html#emptySubst"><span class="hs-identifier hs-var">emptySubst</span></a></span><span> </span><span class="annot"><span class="annottext">IdEnv DIdSet
forall a. VarEnv a
</span><a href="GHC.Types.Var.Env.html#emptyVarEnv"><span class="hs-identifier hs-var">emptyVarEnv</span></a></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-comment">-- Note [Handling floats]</span><span>
</span><span id="line-91"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-92"></span><span class="hs-comment">-- $floats</span><span>
</span><span id="line-93"></span><span class="hs-comment">-- Consider the following expression:</span><span>
</span><span id="line-94"></span><span class="hs-comment">--</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-96"></span><span class="hs-comment">--     f x =</span><span>
</span><span id="line-97"></span><span class="hs-comment">--       let g y = ... f y ...</span><span>
</span><span id="line-98"></span><span class="hs-comment">--       in g x</span><span>
</span><span id="line-99"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-100"></span><span class="hs-comment">--</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- What happens when we want to lift @g@? Normally, we'd put the lifted @l_g@</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- binding above the binding for @f@:</span><span>
</span><span id="line-103"></span><span class="hs-comment">--</span><span>
</span><span id="line-104"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-105"></span><span class="hs-comment">--     g f y = ... f y ...</span><span>
</span><span id="line-106"></span><span class="hs-comment">--     f x = g f x</span><span>
</span><span id="line-107"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-108"></span><span class="hs-comment">--</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- But this very unnecessarily turns a known call to @f@ into an unknown one, in</span><span>
</span><span id="line-110"></span><span class="hs-comment">-- addition to complicating matters for the analysis.</span><span>
</span><span id="line-111"></span><span class="hs-comment">-- Instead, we'd really like to put both functions in the same recursive group,</span><span>
</span><span id="line-112"></span><span class="hs-comment">-- thereby preserving the known call:</span><span>
</span><span id="line-113"></span><span class="hs-comment">--</span><span>
</span><span id="line-114"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-115"></span><span class="hs-comment">--     Rec {</span><span>
</span><span id="line-116"></span><span class="hs-comment">--       g y = ... f y ...</span><span>
</span><span id="line-117"></span><span class="hs-comment">--       f x = g x</span><span>
</span><span id="line-118"></span><span class="hs-comment">--     }</span><span>
</span><span id="line-119"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-120"></span><span class="hs-comment">--</span><span>
</span><span id="line-121"></span><span class="hs-comment">-- But we don't want this to happen for just /any/ binding. That would create</span><span>
</span><span id="line-122"></span><span class="hs-comment">-- possibly huge recursive groups in the process, calling for an occurrence</span><span>
</span><span id="line-123"></span><span class="hs-comment">-- analyser on STG.</span><span>
</span><span id="line-124"></span><span class="hs-comment">-- So, we need to track when we lift a binding out of a recursive RHS and add</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- the binding to the same recursive group as the enclosing recursive binding</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- (which must have either already been at the top-level or decided to be</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- lifted itself in order to preserve the known call).</span><span>
</span><span id="line-128"></span><span class="hs-comment">--</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- This is done by expressing this kind of nesting structure as a 'Writer' over</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- @['FloatLang']@ and flattening this expression in 'runLiftM' by a call to</span><span>
</span><span id="line-131"></span><span class="hs-comment">-- 'collectFloats'.</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- API-wise, the analysis will not need to know about the whole 'FloatLang'</span><span>
</span><span id="line-133"></span><span class="hs-comment">-- business and will just manipulate it indirectly through actions in 'LiftM'.</span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="hs-comment">-- | We need to detect when we are lifting something out of the RHS of a</span><span>
</span><span id="line-136"></span><span class="hs-comment">-- recursive binding (c.f. &quot;GHC.Stg.Lift.Monad#floats&quot;), in which case that</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- binding needs to be added to the same top-level recursive group. This</span><span>
</span><span id="line-138"></span><span class="hs-comment">-- requires we detect a certain nesting structure, which is encoded by</span><span>
</span><span id="line-139"></span><span class="hs-comment">-- 'StartBindingGroup' and 'EndBindingGroup'.</span><span>
</span><span id="line-140"></span><span class="hs-comment">--</span><span>
</span><span id="line-141"></span><span class="hs-comment">-- Although 'collectFloats' will only ever care if the current binding to be</span><span>
</span><span id="line-142"></span><span class="hs-comment">-- lifted (through 'LiftedBinding') will occur inside such a binding group or</span><span>
</span><span id="line-143"></span><span class="hs-comment">-- not, e.g. doesn't care about the nesting level as long as its greater than 0.</span><span>
</span><span id="line-144"></span><span class="hs-keyword">data</span><span> </span><span id="FloatLang"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#FloatLang"><span class="hs-identifier hs-var">FloatLang</span></a></span></span><span>
</span><span id="line-145"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="StartBindingGroup"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#StartBindingGroup"><span class="hs-identifier hs-var">StartBindingGroup</span></a></span></span><span>
</span><span id="line-146"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="EndBindingGroup"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#EndBindingGroup"><span class="hs-identifier hs-var">EndBindingGroup</span></a></span></span><span>
</span><span id="line-147"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PlainTopBinding"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#PlainTopBinding"><span class="hs-identifier hs-var">PlainTopBinding</span></a></span></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgTopBinding"><span class="hs-identifier hs-type">OutStgTopBinding</span></a></span><span>
</span><span id="line-148"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="LiftedBinding"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftedBinding"><span class="hs-identifier hs-var">LiftedBinding</span></a></span></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgBinding"><span class="hs-identifier hs-type">OutStgBinding</span></a></span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680956669"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#FloatLang"><span class="hs-identifier hs-type">FloatLang</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-151"></span><span>  </span><span id="local-6989586621680956662"><span class="annot"><span class="annottext">ppr :: FloatLang -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="annot"><span class="annottext">FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#StartBindingGroup"><span class="hs-identifier hs-var">StartBindingGroup</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span>
</span><span id="line-152"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#EndBindingGroup"><span class="hs-identifier hs-var">EndBindingGroup</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span>
</span><span id="line-153"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#PlainTopBinding"><span class="hs-identifier hs-type">PlainTopBinding</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopStringLit"><span class="hs-identifier hs-type">StgTopStringLit</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;str&gt;&quot;</span></span><span>
</span><span id="line-154"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#PlainTopBinding"><span class="hs-identifier hs-type">PlainTopBinding</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopLifted"><span class="hs-identifier hs-type">StgTopLifted</span></a></span><span> </span><span id="local-6989586621680956656"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680956656"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FloatLang -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla -&gt; FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#LiftedBinding"><span class="hs-identifier hs-var">LiftedBinding</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680956656"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftedBinding"><span class="hs-identifier hs-type">LiftedBinding</span></a></span><span> </span><span id="local-6989586621680956655"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680956655"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">RecFlag -&gt; Bool
</span><a href="GHC.Types.Basic.html#isRec"><span class="hs-identifier hs-var">isRec</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="#local-6989586621680956653"><span class="hs-identifier hs-var">rec</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'r'</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'n'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Id, GenStgRhs 'Vanilla) -&gt; Id)
-&gt; [(Id, GenStgRhs 'Vanilla)] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, GenStgRhs 'Vanilla) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, GenStgRhs 'Vanilla)]
</span><a href="#local-6989586621680956651"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-157"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621680956653"><span class="annot"><span class="annottext">RecFlag
</span><a href="#local-6989586621680956653"><span class="hs-identifier hs-var">rec</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680956651"><span class="annot"><span class="annottext">[(Id, GenStgRhs 'Vanilla)]
</span><a href="#local-6989586621680956651"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
-&gt; (RecFlag, [(BinderP 'Vanilla, GenStgRhs 'Vanilla)])
forall (pass :: StgPass).
GenStgBinding pass -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
</span><a href="GHC.Stg.Lift.Monad.html#decomposeStgBinding"><span class="hs-identifier hs-var">decomposeStgBinding</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680956655"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="hs-comment">-- | Flattens an expression in @['FloatLang']@ into an STG program, see &quot;GHC.Stg.Lift.Monad#floats&quot;.</span><span>
</span><span id="line-160"></span><span class="hs-comment">-- Important pre-conditions: The nesting of opening 'StartBindinGroup's and</span><span>
</span><span id="line-161"></span><span class="hs-comment">-- closing 'EndBindinGroup's is balanced. Also, it is crucial that every binding</span><span>
</span><span id="line-162"></span><span class="hs-comment">-- group has at least one recursive binding inside. Otherwise there's no point</span><span>
</span><span id="line-163"></span><span class="hs-comment">-- in announcing the binding group in the first place and an @ASSERT@ will</span><span>
</span><span id="line-164"></span><span class="hs-comment">-- trigger.</span><span>
</span><span id="line-165"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#collectFloats"><span class="hs-identifier hs-type">collectFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#FloatLang"><span class="hs-identifier hs-type">FloatLang</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgTopBinding"><span class="hs-identifier hs-type">OutStgTopBinding</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-166"></span><span id="collectFloats"><span class="annot"><span class="annottext">collectFloats :: [FloatLang] -&gt; [GenStgTopBinding 'Vanilla]
</span><a href="GHC.Stg.Lift.Monad.html#collectFloats"><span class="hs-identifier hs-var hs-var">collectFloats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
forall {a}.
(Eq a, Num a) =&gt;
a
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
</span><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-167"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-168"></span><span>    </span><span id="local-6989586621680956650"><span class="annot"><span class="annottext">go :: a
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
</span><a href="#local-6989586621680956650"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-169"></span><span>    </span><span class="annot"><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [GenStgTopBinding 'Vanilla]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;collectFloats&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unterminated group&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>    </span><span class="annot"><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680956624"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680956623"><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla]
</span><a href="#local-6989586621680956623"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680956622"><span class="annot"><span class="annottext">FloatLang
</span><a href="#local-6989586621680956622"><span class="hs-identifier hs-var">f</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680956621"><span class="annot"><span class="annottext">[FloatLang]
</span><a href="#local-6989586621680956621"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FloatLang
</span><a href="#local-6989586621680956622"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-171"></span><span>      </span><span class="annot"><span class="annottext">FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#StartBindingGroup"><span class="hs-identifier hs-var">StartBindingGroup</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
</span><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla]
</span><a href="#local-6989586621680956623"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatLang]
</span><a href="#local-6989586621680956621"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-172"></span><span>      </span><span class="annot"><span class="annottext">FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#EndBindingGroup"><span class="hs-identifier hs-var">EndBindingGroup</span></a></span><span>
</span><span id="line-173"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [GenStgTopBinding 'Vanilla]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;collectFloats&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;no group to end&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla -&gt; GenStgTopBinding 'Vanilla
forall (pass :: StgPass).
GenStgBinding pass -&gt; GenStgTopBinding pass
</span><a href="GHC.Stg.Syntax.html#StgTopLifted"><span class="hs-identifier hs-var">StgTopLifted</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla] -&gt; GenStgBinding 'Vanilla
forall {t :: * -&gt; *} {pass :: StgPass}.
Foldable t =&gt;
t (GenStgBinding pass) -&gt; GenStgBinding pass
</span><a href="#local-6989586621680956619"><span class="hs-identifier hs-var">merge_binds</span></a></span><span> </span><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla]
</span><a href="#local-6989586621680956623"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenStgTopBinding 'Vanilla
-&gt; [GenStgTopBinding 'Vanilla] -&gt; [GenStgTopBinding 'Vanilla]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">a
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
</span><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[FloatLang]
</span><a href="#local-6989586621680956621"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-175"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
</span><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla]
</span><a href="#local-6989586621680956623"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatLang]
</span><a href="#local-6989586621680956621"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-176"></span><span>      </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#PlainTopBinding"><span class="hs-identifier hs-type">PlainTopBinding</span></a></span><span> </span><span id="local-6989586621680956618"><span class="annot"><span class="annottext">GenStgTopBinding 'Vanilla
</span><a href="#local-6989586621680956618"><span class="hs-identifier hs-var">top_bind</span></a></span></span><span>
</span><span id="line-177"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenStgTopBinding 'Vanilla
</span><a href="#local-6989586621680956618"><span class="hs-identifier hs-var">top_bind</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgTopBinding 'Vanilla
-&gt; [GenStgTopBinding 'Vanilla] -&gt; [GenStgTopBinding 'Vanilla]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">a
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
</span><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla]
</span><a href="#local-6989586621680956623"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatLang]
</span><a href="#local-6989586621680956621"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-178"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [GenStgTopBinding 'Vanilla]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;collectFloats&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;plain top binding inside group&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-179"></span><span>      </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftedBinding"><span class="hs-identifier hs-type">LiftedBinding</span></a></span><span> </span><span id="local-6989586621680956617"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680956617"><span class="hs-identifier hs-var">bind</span></a></span></span><span>
</span><span id="line-180"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla -&gt; GenStgTopBinding 'Vanilla
forall (pass :: StgPass).
GenStgBinding pass -&gt; GenStgTopBinding pass
</span><a href="GHC.Stg.Syntax.html#StgTopLifted"><span class="hs-identifier hs-var">StgTopLifted</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla -&gt; GenStgBinding 'Vanilla
forall {pass :: StgPass}. GenStgBinding pass -&gt; GenStgBinding pass
</span><a href="#local-6989586621680956616"><span class="hs-identifier hs-var">rm_cccs</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680956617"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenStgTopBinding 'Vanilla
-&gt; [GenStgTopBinding 'Vanilla] -&gt; [GenStgTopBinding 'Vanilla]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">a
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
</span><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla]
</span><a href="#local-6989586621680956623"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatLang]
</span><a href="#local-6989586621680956621"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-181"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
-&gt; [GenStgBinding 'Vanilla]
-&gt; [FloatLang]
-&gt; [GenStgTopBinding 'Vanilla]
</span><a href="#local-6989586621680956650"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680956624"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680956617"><span class="hs-identifier hs-var">bind</span></a></span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
-&gt; [GenStgBinding 'Vanilla] -&gt; [GenStgBinding 'Vanilla]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[GenStgBinding 'Vanilla]
</span><a href="#local-6989586621680956623"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FloatLang]
</span><a href="#local-6989586621680956621"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span>    </span><span id="local-6989586621680956607"><span class="annot"><span class="annottext">map_rhss :: (GenStgRhs pass -&gt; GenStgRhs pass)
-&gt; GenStgBinding pass -&gt; GenStgBinding pass
</span><a href="#local-6989586621680956607"><span class="hs-identifier hs-var hs-var">map_rhss</span></a></span></span><span> </span><span id="local-6989586621680956606"><span class="annot"><span class="annottext">GenStgRhs pass -&gt; GenStgRhs pass
</span><a href="#local-6989586621680956606"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(RecFlag -&gt; [(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass)
-&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
-&gt; GenStgBinding pass
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag -&gt; [(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass
forall (pass :: StgPass).
RecFlag -&gt; [(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass
</span><a href="GHC.Stg.Lift.Monad.html#mkStgBinding"><span class="hs-identifier hs-var">mkStgBinding</span></a></span><span> </span><span class="annot"><span class="annottext">((RecFlag, [(BinderP pass, GenStgRhs pass)]) -&gt; GenStgBinding pass)
-&gt; (GenStgBinding pass
    -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)]))
-&gt; GenStgBinding pass
-&gt; GenStgBinding pass
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([(BinderP pass, GenStgRhs pass)]
 -&gt; [(BinderP pass, GenStgRhs pass)])
-&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
-&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
forall (a :: * -&gt; * -&gt; *) b c d.
Arrow a =&gt;
a b c -&gt; a (d, b) (d, c)
</span><a href="../../base/src/Control.Arrow.html#second"><span class="hs-identifier hs-var">second</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((BinderP pass, GenStgRhs pass) -&gt; (BinderP pass, GenStgRhs pass))
-&gt; [(BinderP pass, GenStgRhs pass)]
-&gt; [(BinderP pass, GenStgRhs pass)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GenStgRhs pass -&gt; GenStgRhs pass)
-&gt; (BinderP pass, GenStgRhs pass) -&gt; (BinderP pass, GenStgRhs pass)
forall (a :: * -&gt; * -&gt; *) b c d.
Arrow a =&gt;
a b c -&gt; a (d, b) (d, c)
</span><a href="../../base/src/Control.Arrow.html#second"><span class="hs-identifier hs-var">second</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgRhs pass -&gt; GenStgRhs pass
</span><a href="#local-6989586621680956606"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((RecFlag, [(BinderP pass, GenStgRhs pass)])
 -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)]))
-&gt; (GenStgBinding pass
    -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)]))
-&gt; GenStgBinding pass
-&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding pass -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
forall (pass :: StgPass).
GenStgBinding pass -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
</span><a href="GHC.Stg.Lift.Monad.html#decomposeStgBinding"><span class="hs-identifier hs-var">decomposeStgBinding</span></a></span><span>
</span><span id="line-184"></span><span>    </span><span id="local-6989586621680956616"><span class="annot"><span class="annottext">rm_cccs :: GenStgBinding pass -&gt; GenStgBinding pass
</span><a href="#local-6989586621680956616"><span class="hs-identifier hs-var hs-var">rm_cccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenStgRhs pass -&gt; GenStgRhs pass)
-&gt; GenStgBinding pass -&gt; GenStgBinding pass
forall {pass :: StgPass} {pass :: StgPass}.
(BinderP pass ~ BinderP pass) =&gt;
(GenStgRhs pass -&gt; GenStgRhs pass)
-&gt; GenStgBinding pass -&gt; GenStgBinding pass
</span><a href="#local-6989586621680956607"><span class="hs-identifier hs-var">map_rhss</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgRhs pass -&gt; GenStgRhs pass
forall (pass :: StgPass). GenStgRhs pass -&gt; GenStgRhs pass
</span><a href="GHC.Stg.Lift.Monad.html#removeRhsCCCS"><span class="hs-identifier hs-var">removeRhsCCCS</span></a></span><span>
</span><span id="line-185"></span><span>    </span><span id="local-6989586621680956619"><span class="annot"><span class="annottext">merge_binds :: t (GenStgBinding pass) -&gt; GenStgBinding pass
</span><a href="#local-6989586621680956619"><span class="hs-identifier hs-var hs-var">merge_binds</span></a></span></span><span> </span><span id="local-6989586621680956599"><span class="annot"><span class="annottext">t (GenStgBinding pass)
</span><a href="#local-6989586621680956599"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">any</span><span> </span><span class="hs-identifier">is_rec</span><span> </span><span class="hs-identifier">binds</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span>                        </span><span class="annot"><span class="annottext">[(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass
forall (pass :: StgPass).
[(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass
</span><a href="GHC.Stg.Syntax.html#StgRec"><span class="hs-identifier hs-var">StgRec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GenStgBinding pass -&gt; [(BinderP pass, GenStgRhs pass)])
-&gt; t (GenStgBinding pass) -&gt; [(BinderP pass, GenStgRhs pass)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(RecFlag, [(BinderP pass, GenStgRhs pass)])
-&gt; [(BinderP pass, GenStgRhs pass)]
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">((RecFlag, [(BinderP pass, GenStgRhs pass)])
 -&gt; [(BinderP pass, GenStgRhs pass)])
-&gt; (GenStgBinding pass
    -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)]))
-&gt; GenStgBinding pass
-&gt; [(BinderP pass, GenStgRhs pass)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding pass -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
forall (pass :: StgPass).
GenStgBinding pass -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
</span><a href="GHC.Stg.Lift.Monad.html#decomposeStgBinding"><span class="hs-identifier hs-var">decomposeStgBinding</span></a></span><span> </span><span class="annot"><span class="annottext">(GenStgBinding pass -&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)]))
-&gt; (GenStgBinding pass -&gt; GenStgBinding pass)
-&gt; GenStgBinding pass
-&gt; (RecFlag, [(BinderP pass, GenStgRhs pass)])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding pass -&gt; GenStgBinding pass
forall {pass :: StgPass}. GenStgBinding pass -&gt; GenStgBinding pass
</span><a href="#local-6989586621680956616"><span class="hs-identifier hs-var">rm_cccs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">t (GenStgBinding pass)
</span><a href="#local-6989586621680956599"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-187"></span><span>    </span><span id="local-6989586621680956594"><span class="annot"><span class="annottext">is_rec :: GenStgBinding pass -&gt; Bool
</span><a href="#local-6989586621680956594"><span class="hs-identifier hs-var hs-var">is_rec</span></a></span></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRec"><span class="hs-identifier hs-type">StgRec</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-188"></span><span>    </span><span class="annot"><a href="#local-6989586621680956594"><span class="hs-identifier hs-var">is_rec</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span class="hs-comment">-- | Omitting this makes for strange closure allocation schemes that crash the</span><span>
</span><span id="line-191"></span><span class="hs-comment">-- GC.</span><span>
</span><span id="line-192"></span><span id="local-6989586621680956899"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#removeRhsCCCS"><span class="hs-identifier hs-type">removeRhsCCCS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#GenStgRhs"><span class="hs-identifier hs-type">GenStgRhs</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956899"><span class="hs-identifier hs-type">pass</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#GenStgRhs"><span class="hs-identifier hs-type">GenStgRhs</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956899"><span class="hs-identifier hs-type">pass</span></a></span></span><span>
</span><span id="line-193"></span><span id="removeRhsCCCS"><span class="annot"><span class="annottext">removeRhsCCCS :: forall (pass :: StgPass). GenStgRhs pass -&gt; GenStgRhs pass
</span><a href="GHC.Stg.Lift.Monad.html#removeRhsCCCS"><span class="hs-identifier hs-var hs-var">removeRhsCCCS</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhsClosure"><span class="hs-identifier hs-type">StgRhsClosure</span></a></span><span> </span><span id="local-6989586621680956590"><span class="annot"><span class="annottext">XRhsClosure pass
</span><a href="#local-6989586621680956590"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span id="local-6989586621680956589"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621680956589"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621680956588"><span class="annot"><span class="annottext">UpdateFlag
</span><a href="#local-6989586621680956588"><span class="hs-identifier hs-var">upd</span></a></span></span><span> </span><span id="local-6989586621680956587"><span class="annot"><span class="annottext">[BinderP pass]
</span><a href="#local-6989586621680956587"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span id="local-6989586621680956586"><span class="annot"><span class="annottext">GenStgExpr pass
</span><a href="#local-6989586621680956586"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-194"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CostCentreStack -&gt; Bool
</span><a href="GHC.Types.CostCentre.html#isCurrentCCS"><span class="hs-identifier hs-var">isCurrentCCS</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621680956589"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-195"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XRhsClosure pass
-&gt; CostCentreStack
-&gt; UpdateFlag
-&gt; [BinderP pass]
-&gt; GenStgExpr pass
-&gt; GenStgRhs pass
forall (pass :: StgPass).
XRhsClosure pass
-&gt; CostCentreStack
-&gt; UpdateFlag
-&gt; [BinderP pass]
-&gt; GenStgExpr pass
-&gt; GenStgRhs pass
</span><a href="GHC.Stg.Syntax.html#StgRhsClosure"><span class="hs-identifier hs-var">StgRhsClosure</span></a></span><span> </span><span class="annot"><span class="annottext">XRhsClosure pass
</span><a href="#local-6989586621680956590"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="GHC.Types.CostCentre.html#dontCareCCS"><span class="hs-identifier hs-var">dontCareCCS</span></a></span><span> </span><span class="annot"><span class="annottext">UpdateFlag
</span><a href="#local-6989586621680956588"><span class="hs-identifier hs-var">upd</span></a></span><span> </span><span class="annot"><span class="annottext">[BinderP pass]
</span><a href="#local-6989586621680956587"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr pass
</span><a href="#local-6989586621680956586"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-196"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#removeRhsCCCS"><span class="hs-identifier hs-var">removeRhsCCCS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhsCon"><span class="hs-identifier hs-type">StgRhsCon</span></a></span><span> </span><span id="local-6989586621680956584"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621680956584"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621680956583"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680956583"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621680956582"><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680956582"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-197"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CostCentreStack -&gt; Bool
</span><a href="GHC.Types.CostCentre.html#isCurrentCCS"><span class="hs-identifier hs-var">isCurrentCCS</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621680956584"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-198"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CostCentreStack -&gt; DataCon -&gt; [StgArg] -&gt; GenStgRhs pass
forall (pass :: StgPass).
CostCentreStack -&gt; DataCon -&gt; [StgArg] -&gt; GenStgRhs pass
</span><a href="GHC.Stg.Syntax.html#StgRhsCon"><span class="hs-identifier hs-var">StgRhsCon</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="GHC.Types.CostCentre.html#dontCareCCS"><span class="hs-identifier hs-var">dontCareCCS</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680956583"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680956582"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-199"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#removeRhsCCCS"><span class="hs-identifier hs-var">removeRhsCCCS</span></a></span><span> </span><span id="local-6989586621680956581"><span class="annot"><span class="annottext">GenStgRhs pass
</span><a href="#local-6989586621680956581"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgRhs pass
</span><a href="#local-6989586621680956581"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="hs-comment">-- | The analysis monad consists of the following 'RWST' components:</span><span>
</span><span id="line-202"></span><span class="hs-comment">--</span><span>
</span><span id="line-203"></span><span class="hs-comment">--     * 'Env': Reader-like context. Contains a substitution, info about how</span><span>
</span><span id="line-204"></span><span class="hs-comment">--       how lifted identifiers are to be expanded into applications and details</span><span>
</span><span id="line-205"></span><span class="hs-comment">--       such as 'DynFlags'.</span><span>
</span><span id="line-206"></span><span class="hs-comment">--</span><span>
</span><span id="line-207"></span><span class="hs-comment">--     * @'OrdList' 'FloatLang'@: Writer output for the resulting STG program.</span><span>
</span><span id="line-208"></span><span class="hs-comment">--</span><span>
</span><span id="line-209"></span><span class="hs-comment">--     * No pure state component</span><span>
</span><span id="line-210"></span><span class="hs-comment">--</span><span>
</span><span id="line-211"></span><span class="hs-comment">--     * But wrapping around 'UniqSM' for generating fresh lifted binders.</span><span>
</span><span id="line-212"></span><span class="hs-comment">--       (The @uniqAway@ approach could give the same name to two different</span><span>
</span><span id="line-213"></span><span class="hs-comment">--       lifted binders, so this is necessary.)</span><span>
</span><span id="line-214"></span><span class="hs-keyword">newtype</span><span> </span><span id="LiftM"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span></span><span> </span><span id="local-6989586621680956881"><span class="annot"><a href="#local-6989586621680956881"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-215"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="LiftM"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="unwrapLiftM"><span class="annot"><span class="annottext">forall a. LiftM a -&gt; RWST Env (OrdList FloatLang) () UniqSM a
</span><a href="GHC.Stg.Lift.Monad.html#unwrapLiftM"><span class="hs-identifier hs-var hs-var">unwrapLiftM</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">RWST</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#Env"><span class="hs-identifier hs-type">Env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#FloatLang"><span class="hs-identifier hs-type">FloatLang</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956881"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-216"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680956572"><span id="local-6989586621680956577"><span class="annot"><span class="annottext">(forall a b. (a -&gt; b) -&gt; LiftM a -&gt; LiftM b)
-&gt; (forall a b. a -&gt; LiftM b -&gt; LiftM a) -&gt; Functor LiftM
forall a b. a -&gt; LiftM b -&gt; LiftM a
forall a b. (a -&gt; b) -&gt; LiftM a -&gt; LiftM b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: forall a b. a -&gt; LiftM b -&gt; LiftM a
$c&lt;$ :: forall a b. a -&gt; LiftM b -&gt; LiftM a
fmap :: forall a b. (a -&gt; b) -&gt; LiftM a -&gt; LiftM b
$cfmap :: forall a b. (a -&gt; b) -&gt; LiftM a -&gt; LiftM b
</span><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></a></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680956548"><span id="local-6989586621680956552"><span id="local-6989586621680956556"><span id="local-6989586621680956560"><span id="local-6989586621680956564"><span class="annot"><span class="annottext">Functor LiftM
Functor LiftM
-&gt; (forall a. a -&gt; LiftM a)
-&gt; (forall a b. LiftM (a -&gt; b) -&gt; LiftM a -&gt; LiftM b)
-&gt; (forall a b c. (a -&gt; b -&gt; c) -&gt; LiftM a -&gt; LiftM b -&gt; LiftM c)
-&gt; (forall a b. LiftM a -&gt; LiftM b -&gt; LiftM b)
-&gt; (forall a b. LiftM a -&gt; LiftM b -&gt; LiftM a)
-&gt; Applicative LiftM
forall a. a -&gt; LiftM a
forall a b. LiftM a -&gt; LiftM b -&gt; LiftM a
forall a b. LiftM a -&gt; LiftM b -&gt; LiftM b
forall a b. LiftM (a -&gt; b) -&gt; LiftM a -&gt; LiftM b
forall a b c. (a -&gt; b -&gt; c) -&gt; LiftM a -&gt; LiftM b -&gt; LiftM c
forall (f :: * -&gt; *).
Functor f
-&gt; (forall a. a -&gt; f a)
-&gt; (forall a b. f (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b c. (a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c)
-&gt; (forall a b. f a -&gt; f b -&gt; f b)
-&gt; (forall a b. f a -&gt; f b -&gt; f a)
-&gt; Applicative f
&lt;* :: forall a b. LiftM a -&gt; LiftM b -&gt; LiftM a
$c&lt;* :: forall a b. LiftM a -&gt; LiftM b -&gt; LiftM a
*&gt; :: forall a b. LiftM a -&gt; LiftM b -&gt; LiftM b
$c*&gt; :: forall a b. LiftM a -&gt; LiftM b -&gt; LiftM b
liftA2 :: forall a b c. (a -&gt; b -&gt; c) -&gt; LiftM a -&gt; LiftM b -&gt; LiftM c
$cliftA2 :: forall a b c. (a -&gt; b -&gt; c) -&gt; LiftM a -&gt; LiftM b -&gt; LiftM c
&lt;*&gt; :: forall a b. LiftM (a -&gt; b) -&gt; LiftM a -&gt; LiftM b
$c&lt;*&gt; :: forall a b. LiftM (a -&gt; b) -&gt; LiftM a -&gt; LiftM b
pure :: forall a. a -&gt; LiftM a
$cpure :: forall a. a -&gt; LiftM a
</span><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Applicative</span></a></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680956532"><span id="local-6989586621680956536"><span id="local-6989586621680956540"><span class="annot"><span class="annottext">Applicative LiftM
Applicative LiftM
-&gt; (forall a b. LiftM a -&gt; (a -&gt; LiftM b) -&gt; LiftM b)
-&gt; (forall a b. LiftM a -&gt; LiftM b -&gt; LiftM b)
-&gt; (forall a. a -&gt; LiftM a)
-&gt; Monad LiftM
forall a. a -&gt; LiftM a
forall a b. LiftM a -&gt; LiftM b -&gt; LiftM b
forall a b. LiftM a -&gt; (a -&gt; LiftM b) -&gt; LiftM b
forall (m :: * -&gt; *).
Applicative m
-&gt; (forall a b. m a -&gt; (a -&gt; m b) -&gt; m b)
-&gt; (forall a b. m a -&gt; m b -&gt; m b)
-&gt; (forall a. a -&gt; m a)
-&gt; Monad m
return :: forall a. a -&gt; LiftM a
$creturn :: forall a. a -&gt; LiftM a
&gt;&gt; :: forall a b. LiftM a -&gt; LiftM b -&gt; LiftM b
$c&gt;&gt; :: forall a b. LiftM a -&gt; LiftM b -&gt; LiftM b
&gt;&gt;= :: forall a b. LiftM a -&gt; (a -&gt; LiftM b) -&gt; LiftM b
$c&gt;&gt;= :: forall a b. LiftM a -&gt; (a -&gt; LiftM b) -&gt; LiftM b
</span><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Monad</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#HasDynFlags"><span class="hs-identifier hs-type">HasDynFlags</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-219"></span><span>  </span><span id="local-6989586621680956522"><span class="annot"><span class="annottext">getDynFlags :: LiftM DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var hs-var hs-var hs-var">getDynFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM DynFlags -&gt; LiftM DynFlags
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Env -&gt; DynFlags)
-&gt; RWST Env (OrdList FloatLang) () UniqSM DynFlags
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#asks"><span class="hs-identifier hs-var">RWS.asks</span></a></span><span> </span><span class="annot"><span class="annottext">Env -&gt; DynFlags
</span><a href="GHC.Stg.Lift.Monad.html#e_dflags"><span class="hs-identifier hs-var hs-var">e_dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#MonadUnique"><span class="hs-identifier hs-type">MonadUnique</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-222"></span><span>  </span><span id="local-6989586621680956507"><span class="annot"><span class="annottext">getUniqueSupplyM :: LiftM UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#getUniqueSupplyM"><span class="hs-identifier hs-var hs-var hs-var hs-var">getUniqueSupplyM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM UniqSupply
-&gt; LiftM UniqSupply
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSM UniqSupply
-&gt; RWST Env (OrdList FloatLang) () UniqSM UniqSupply
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSM UniqSupply
forall (m :: * -&gt; *). MonadUnique m =&gt; m UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#getUniqueSupplyM"><span class="hs-identifier hs-var">getUniqueSupplyM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-223"></span><span>  </span><span id="local-6989586621680956501"><span class="annot"><span class="annottext">getUniqueM :: LiftM Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var hs-var hs-var hs-var">getUniqueM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM Unique -&gt; LiftM Unique
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSM Unique -&gt; RWST Env (OrdList FloatLang) () UniqSM Unique
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSM Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-224"></span><span>  </span><span id="local-6989586621680956496"><span class="annot"><span class="annottext">getUniquesM :: LiftM [Unique]
</span><a href="GHC.Types.Unique.Supply.html#getUniquesM"><span class="hs-identifier hs-var hs-var hs-var hs-var">getUniquesM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM [Unique] -&gt; LiftM [Unique]
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSM [Unique] -&gt; RWST Env (OrdList FloatLang) () UniqSM [Unique]
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSM [Unique]
forall (m :: * -&gt; *). MonadUnique m =&gt; m [Unique]
</span><a href="GHC.Types.Unique.Supply.html#getUniquesM"><span class="hs-identifier hs-var">getUniquesM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#runLiftM"><span class="hs-identifier hs-type">runLiftM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgTopBinding"><span class="hs-identifier hs-type">OutStgTopBinding</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-227"></span><span id="runLiftM"><span class="annot"><span class="annottext">runLiftM :: DynFlags -&gt; UniqSupply -&gt; LiftM () -&gt; [GenStgTopBinding 'Vanilla]
</span><a href="GHC.Stg.Lift.Monad.html#runLiftM"><span class="hs-identifier hs-var hs-var">runLiftM</span></a></span></span><span> </span><span id="local-6989586621680956494"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680956494"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680956493"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680956493"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span id="local-6989586621680956492"><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM ()
</span><a href="#local-6989586621680956492"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FloatLang] -&gt; [GenStgTopBinding 'Vanilla]
</span><a href="GHC.Stg.Lift.Monad.html#collectFloats"><span class="hs-identifier hs-var">collectFloats</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList FloatLang -&gt; [FloatLang]
forall a. OrdList a -&gt; [a]
</span><a href="GHC.Data.OrdList.html#fromOL"><span class="hs-identifier hs-var">fromOL</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatLang
</span><a href="#local-6989586621680956490"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-229"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680956490"><span class="annot"><span class="annottext">OrdList FloatLang
</span><a href="#local-6989586621680956490"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
-&gt; UniqSM ((), (), OrdList FloatLang)
-&gt; ((), (), OrdList FloatLang)
forall a. UniqSupply -&gt; UniqSM a -&gt; a
</span><a href="GHC.Types.Unique.Supply.html#initUs_"><span class="hs-identifier hs-var">initUs_</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680956493"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM ()
-&gt; Env -&gt; () -&gt; UniqSM ((), (), OrdList FloatLang)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM ()
</span><a href="#local-6989586621680956492"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Env
</span><a href="GHC.Stg.Lift.Monad.html#emptyEnv"><span class="hs-identifier hs-var">emptyEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680956494"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span class="hs-comment">-- | Writes a plain 'StgTopStringLit' to the output.</span><span>
</span><span id="line-232"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#addTopStringLit"><span class="hs-identifier hs-type">addTopStringLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#OutId"><span class="hs-identifier hs-type">OutId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span id="addTopStringLit"><span class="annot"><span class="annottext">addTopStringLit :: Id -&gt; ByteString -&gt; LiftM ()
</span><a href="GHC.Stg.Lift.Monad.html#addTopStringLit"><span class="hs-identifier hs-var hs-var">addTopStringLit</span></a></span></span><span> </span><span id="local-6989586621680956487"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956487"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ()
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="annot"><span class="annottext">(RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ())
-&gt; (ByteString -&gt; RWST Env (OrdList FloatLang) () UniqSM ())
-&gt; ByteString
-&gt; LiftM ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ()
forall (m :: * -&gt; *) w r s. Monad m =&gt; w -&gt; RWST r w s m ()
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#tell"><span class="hs-identifier hs-var">RWS.tell</span></a></span><span> </span><span class="annot"><span class="annottext">(OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ())
-&gt; (ByteString -&gt; OrdList FloatLang)
-&gt; ByteString
-&gt; RWST Env (OrdList FloatLang) () UniqSM ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FloatLang -&gt; OrdList FloatLang
forall a. a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#unitOL"><span class="hs-identifier hs-var">unitOL</span></a></span><span> </span><span class="annot"><span class="annottext">(FloatLang -&gt; OrdList FloatLang)
-&gt; (ByteString -&gt; FloatLang) -&gt; ByteString -&gt; OrdList FloatLang
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgTopBinding 'Vanilla -&gt; FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#PlainTopBinding"><span class="hs-identifier hs-var">PlainTopBinding</span></a></span><span> </span><span class="annot"><span class="annottext">(GenStgTopBinding 'Vanilla -&gt; FloatLang)
-&gt; (ByteString -&gt; GenStgTopBinding 'Vanilla)
-&gt; ByteString
-&gt; FloatLang
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; ByteString -&gt; GenStgTopBinding 'Vanilla
forall (pass :: StgPass). Id -&gt; ByteString -&gt; GenStgTopBinding pass
</span><a href="GHC.Stg.Syntax.html#StgTopStringLit"><span class="hs-identifier hs-var">StgTopStringLit</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956487"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="hs-comment">-- | Starts a recursive binding group. See &quot;GHC.Stg.Lift.Monad#floats&quot; and 'collectFloats'.</span><span>
</span><span id="line-236"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#startBindingGroup"><span class="hs-identifier hs-type">startBindingGroup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span id="startBindingGroup"><span class="annot"><span class="annottext">startBindingGroup :: LiftM ()
</span><a href="GHC.Stg.Lift.Monad.html#startBindingGroup"><span class="hs-identifier hs-var hs-var">startBindingGroup</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ()
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="annot"><span class="annottext">(RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ())
-&gt; RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ()
forall (m :: * -&gt; *) w r s. Monad m =&gt; w -&gt; RWST r w s m ()
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#tell"><span class="hs-identifier hs-var">RWS.tell</span></a></span><span> </span><span class="annot"><span class="annottext">(OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ())
-&gt; OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FloatLang -&gt; OrdList FloatLang
forall a. a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#unitOL"><span class="hs-identifier hs-var">unitOL</span></a></span><span> </span><span class="annot"><span class="annottext">(FloatLang -&gt; OrdList FloatLang) -&gt; FloatLang -&gt; OrdList FloatLang
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#StartBindingGroup"><span class="hs-identifier hs-var">StartBindingGroup</span></a></span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span class="hs-comment">-- | Ends a recursive binding group. See &quot;GHC.Stg.Lift.Monad#floats&quot; and 'collectFloats'.</span><span>
</span><span id="line-240"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#endBindingGroup"><span class="hs-identifier hs-type">endBindingGroup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-241"></span><span id="endBindingGroup"><span class="annot"><span class="annottext">endBindingGroup :: LiftM ()
</span><a href="GHC.Stg.Lift.Monad.html#endBindingGroup"><span class="hs-identifier hs-var hs-var">endBindingGroup</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ()
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="annot"><span class="annottext">(RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ())
-&gt; RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ()
forall (m :: * -&gt; *) w r s. Monad m =&gt; w -&gt; RWST r w s m ()
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#tell"><span class="hs-identifier hs-var">RWS.tell</span></a></span><span> </span><span class="annot"><span class="annottext">(OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ())
-&gt; OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FloatLang -&gt; OrdList FloatLang
forall a. a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#unitOL"><span class="hs-identifier hs-var">unitOL</span></a></span><span> </span><span class="annot"><span class="annottext">(FloatLang -&gt; OrdList FloatLang) -&gt; FloatLang -&gt; OrdList FloatLang
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#EndBindingGroup"><span class="hs-identifier hs-var">EndBindingGroup</span></a></span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span class="hs-comment">-- | Lifts a binding to top-level. Depending on whether it's declared inside</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- a recursive RHS (see &quot;GHC.Stg.Lift.Monad#floats&quot; and 'collectFloats'), this might be added to</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- an existing recursive top-level binding group.</span><span>
</span><span id="line-246"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#addLiftedBinding"><span class="hs-identifier hs-type">addLiftedBinding</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgBinding"><span class="hs-identifier hs-type">OutStgBinding</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-247"></span><span id="addLiftedBinding"><span class="annot"><span class="annottext">addLiftedBinding :: GenStgBinding 'Vanilla -&gt; LiftM ()
</span><a href="GHC.Stg.Lift.Monad.html#addLiftedBinding"><span class="hs-identifier hs-var hs-var">addLiftedBinding</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ()
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="annot"><span class="annottext">(RWST Env (OrdList FloatLang) () UniqSM () -&gt; LiftM ())
-&gt; (GenStgBinding 'Vanilla
    -&gt; RWST Env (OrdList FloatLang) () UniqSM ())
-&gt; GenStgBinding 'Vanilla
-&gt; LiftM ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ()
forall (m :: * -&gt; *) w r s. Monad m =&gt; w -&gt; RWST r w s m ()
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#tell"><span class="hs-identifier hs-var">RWS.tell</span></a></span><span> </span><span class="annot"><span class="annottext">(OrdList FloatLang -&gt; RWST Env (OrdList FloatLang) () UniqSM ())
-&gt; (GenStgBinding 'Vanilla -&gt; OrdList FloatLang)
-&gt; GenStgBinding 'Vanilla
-&gt; RWST Env (OrdList FloatLang) () UniqSM ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FloatLang -&gt; OrdList FloatLang
forall a. a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#unitOL"><span class="hs-identifier hs-var">unitOL</span></a></span><span> </span><span class="annot"><span class="annottext">(FloatLang -&gt; OrdList FloatLang)
-&gt; (GenStgBinding 'Vanilla -&gt; FloatLang)
-&gt; GenStgBinding 'Vanilla
-&gt; OrdList FloatLang
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla -&gt; FloatLang
</span><a href="GHC.Stg.Lift.Monad.html#LiftedBinding"><span class="hs-identifier hs-var">LiftedBinding</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">-- | Takes a binder and a continuation which is called with the substituted</span><span>
</span><span id="line-250"></span><span class="hs-comment">-- binder. The continuation will be evaluated in a 'LiftM' context in which that</span><span>
</span><span id="line-251"></span><span class="hs-comment">-- binder is deemed in scope. Think of it as a 'RWS.local' computation: After</span><span>
</span><span id="line-252"></span><span class="hs-comment">-- the continuation finishes, the new binding won't be in scope anymore.</span><span>
</span><span id="line-253"></span><span id="local-6989586621680956799"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#withSubstBndr"><span class="hs-identifier hs-type">withSubstBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956799"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956799"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-254"></span><span id="withSubstBndr"><span class="annot"><span class="annottext">withSubstBndr :: forall a. Id -&gt; (Id -&gt; LiftM a) -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#withSubstBndr"><span class="hs-identifier hs-var hs-var">withSubstBndr</span></a></span></span><span> </span><span id="local-6989586621680956481"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956481"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680956480"><span class="annot"><span class="annottext">Id -&gt; LiftM a
</span><a href="#local-6989586621680956480"><span class="hs-identifier hs-var">inner</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="annot"><span class="annottext">(RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a)
-&gt; RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-255"></span><span>  </span><span id="local-6989586621680956479"><span class="annot"><span class="annottext">Subst
</span><a href="#local-6989586621680956479"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Env -&gt; Subst) -&gt; RWST Env (OrdList FloatLang) () UniqSM Subst
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#asks"><span class="hs-identifier hs-var">RWS.asks</span></a></span><span> </span><span class="annot"><span class="annottext">Env -&gt; Subst
</span><a href="GHC.Stg.Lift.Monad.html#e_subst"><span class="hs-identifier hs-var hs-var">e_subst</span></a></span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680956478"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956478"><span class="hs-identifier hs-var">bndr'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680956477"><span class="annot"><span class="annottext">Subst
</span><a href="#local-6989586621680956477"><span class="hs-identifier hs-var">subst'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Subst -&gt; (Id, Subst)
</span><a href="GHC.Stg.Subst.html#substBndr"><span class="hs-identifier hs-var">substBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956481"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Subst
</span><a href="#local-6989586621680956479"><span class="hs-identifier hs-var">subst</span></a></span><span>
</span><span id="line-257"></span><span>  </span><span class="annot"><span class="annottext">(Env -&gt; Env)
-&gt; RWST Env (OrdList FloatLang) () UniqSM a
-&gt; RWST Env (OrdList FloatLang) () UniqSM a
forall r w s (m :: * -&gt; *) a.
(r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#local"><span class="hs-identifier hs-var">RWS.local</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680956474"><span class="annot"><span class="annottext">Env
</span><a href="#local-6989586621680956474"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Env
</span><a href="#local-6989586621680956474"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">e_subst :: Subst
</span><a href="GHC.Stg.Lift.Monad.html#e_subst"><span class="hs-identifier hs-var">e_subst</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Subst
</span><a href="#local-6989586621680956477"><span class="hs-identifier hs-var">subst'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LiftM a -&gt; RWST Env (OrdList FloatLang) () UniqSM a
forall a. LiftM a -&gt; RWST Env (OrdList FloatLang) () UniqSM a
</span><a href="GHC.Stg.Lift.Monad.html#unwrapLiftM"><span class="hs-identifier hs-var hs-var">unwrapLiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; LiftM a
</span><a href="#local-6989586621680956480"><span class="hs-identifier hs-var">inner</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956478"><span class="hs-identifier hs-var">bndr'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-comment">-- | See 'withSubstBndr'.</span><span>
</span><span id="line-260"></span><span id="local-6989586621680956791"><span id="local-6989586621680956792"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#withSubstBndrs"><span class="hs-identifier hs-type">withSubstBndrs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">Traversable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956792"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680956792"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680956792"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956791"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956791"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-261"></span><span id="withSubstBndrs"><span class="annot"><span class="annottext">withSubstBndrs :: forall (f :: * -&gt; *) a.
Traversable f =&gt;
f Id -&gt; (f Id -&gt; LiftM a) -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#withSubstBndrs"><span class="hs-identifier hs-var hs-var">withSubstBndrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ContT a LiftM (f Id) -&gt; (f Id -&gt; LiftM a) -&gt; LiftM a
forall {k} (r :: k) (m :: k -&gt; *) a.
ContT r m a -&gt; (a -&gt; m r) -&gt; m r
</span><a href="../../transformers/src/Control.Monad.Trans.Cont.html#runContT"><span class="hs-identifier hs-var hs-var">runContT</span></a></span><span> </span><span class="annot"><span class="annottext">(ContT a LiftM (f Id) -&gt; (f Id -&gt; LiftM a) -&gt; LiftM a)
-&gt; (f Id -&gt; ContT a LiftM (f Id))
-&gt; f Id
-&gt; (f Id -&gt; LiftM a)
-&gt; LiftM a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Id -&gt; ContT a LiftM Id) -&gt; f Id -&gt; ContT a LiftM (f Id)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Id -&gt; LiftM a) -&gt; LiftM a) -&gt; ContT a LiftM Id
forall {k} (r :: k) (m :: k -&gt; *) a.
((a -&gt; m r) -&gt; m r) -&gt; ContT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Cont.html#ContT"><span class="hs-identifier hs-var">ContT</span></a></span><span> </span><span class="annot"><span class="annottext">(((Id -&gt; LiftM a) -&gt; LiftM a) -&gt; ContT a LiftM Id)
-&gt; (Id -&gt; (Id -&gt; LiftM a) -&gt; LiftM a) -&gt; Id -&gt; ContT a LiftM Id
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; (Id -&gt; LiftM a) -&gt; LiftM a
forall a. Id -&gt; (Id -&gt; LiftM a) -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#withSubstBndr"><span class="hs-identifier hs-var">withSubstBndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span class="hs-comment">-- | Similarly to 'withSubstBndr', this function takes a set of variables to</span><span>
</span><span id="line-264"></span><span class="hs-comment">-- abstract over, the binder to lift (and generate a fresh, substituted name</span><span>
</span><span id="line-265"></span><span class="hs-comment">-- for) and a continuation in which that fresh, lifted binder is in scope.</span><span>
</span><span id="line-266"></span><span class="hs-comment">--</span><span>
</span><span id="line-267"></span><span class="hs-comment">-- It takes care of all the details involved with copying and adjusting the</span><span>
</span><span id="line-268"></span><span class="hs-comment">-- binder and fresh name generation.</span><span>
</span><span id="line-269"></span><span id="local-6989586621680956772"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#withLiftedBndr"><span class="hs-identifier hs-type">withLiftedBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956772"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956772"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-270"></span><span id="withLiftedBndr"><span class="annot"><span class="annottext">withLiftedBndr :: forall a. DIdSet -&gt; Id -&gt; (Id -&gt; LiftM a) -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#withLiftedBndr"><span class="hs-identifier hs-var hs-var">withLiftedBndr</span></a></span></span><span> </span><span id="local-6989586621680956462"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956462"><span class="hs-identifier hs-var">abs_ids</span></a></span></span><span> </span><span id="local-6989586621680956461"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956461"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680956460"><span class="annot"><span class="annottext">Id -&gt; LiftM a
</span><a href="#local-6989586621680956460"><span class="hs-identifier hs-var">inner</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-271"></span><span>  </span><span id="local-6989586621680956459"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680956459"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LiftM Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span>
</span><span id="line-272"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680956458"><span class="annot"><span class="annottext">str :: String
</span><a href="#local-6989586621680956458"><span class="hs-identifier hs-var hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;$l&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; String
</span><a href="GHC.Types.Name.Occurrence.html#occNameString"><span class="hs-identifier hs-var">occNameString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; OccName
forall a. NamedThing a =&gt; a -&gt; OccName
</span><a href="GHC.Types.Name.html#getOccName"><span class="hs-identifier hs-var">getOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956461"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-273"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680956455"><span class="annot"><span class="annottext">ty :: Type
</span><a href="#local-6989586621680956455"><span class="hs-identifier hs-var hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; Type
</span><a href="GHC.Core.Utils.html#mkLamTypes"><span class="hs-identifier hs-var">mkLamTypes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DIdSet -&gt; [Id]
</span><a href="GHC.Types.Var.Set.html#dVarSetElems"><span class="hs-identifier hs-var">dVarSetElems</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956462"><span class="hs-identifier hs-var">abs_ids</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956461"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-274"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680956451"><span class="annot"><span class="annottext">bndr' :: Id
</span><a href="#local-6989586621680956451"><span class="hs-identifier hs-var hs-var">bndr'</span></a></span></span><span>
</span><span id="line-275"></span><span>        </span><span class="hs-comment">-- See Note [transferPolyIdInfo] in GHC.Types.Id. We need to do this at least</span><span>
</span><span id="line-276"></span><span>        </span><span class="hs-comment">-- for arity information.</span><span>
</span><span id="line-277"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; Id -&gt; Id
</span><a href="GHC.Types.Id.html#transferPolyIdInfo"><span class="hs-identifier hs-var">transferPolyIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956461"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DIdSet -&gt; [Id]
</span><a href="GHC.Types.Var.Set.html#dVarSetElems"><span class="hs-identifier hs-var">dVarSetElems</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956462"><span class="hs-identifier hs-var">abs_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-278"></span><span>        </span><span class="annot"><span class="annottext">(Id -&gt; Id) -&gt; (Type -&gt; Id) -&gt; Type -&gt; Id
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Unique -&gt; Type -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#mkSysLocal"><span class="hs-identifier hs-var">mkSysLocal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680956458"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680956459"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span>
</span><span id="line-279"></span><span>        </span><span class="annot"><span class="annottext">(Type -&gt; Id) -&gt; Type -&gt; Id
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680956455"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-280"></span><span>  </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="annot"><span class="annottext">(RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a)
-&gt; RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Env -&gt; Env)
-&gt; RWST Env (OrdList FloatLang) () UniqSM a
-&gt; RWST Env (OrdList FloatLang) () UniqSM a
forall r w s (m :: * -&gt; *) a.
(r -&gt; r) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#local"><span class="hs-identifier hs-var">RWS.local</span></a></span><span>
</span><span id="line-281"></span><span>    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680956446"><span class="annot"><span class="annottext">Env
</span><a href="#local-6989586621680956446"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Env
</span><a href="#local-6989586621680956446"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-282"></span><span>      </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">e_subst :: Subst
</span><a href="GHC.Stg.Lift.Monad.html#e_subst"><span class="hs-identifier hs-var">e_subst</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Subst -&gt; Subst
</span><a href="GHC.Stg.Subst.html#extendSubst"><span class="hs-identifier hs-var">extendSubst</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956461"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956451"><span class="hs-identifier hs-var">bndr'</span></a></span><span> </span><span class="annot"><span class="annottext">(Subst -&gt; Subst) -&gt; Subst -&gt; Subst
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Subst -&gt; Subst
</span><a href="GHC.Stg.Subst.html#extendInScope"><span class="hs-identifier hs-var">extendInScope</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956451"><span class="hs-identifier hs-var">bndr'</span></a></span><span> </span><span class="annot"><span class="annottext">(Subst -&gt; Subst) -&gt; Subst -&gt; Subst
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Env -&gt; Subst
</span><a href="GHC.Stg.Lift.Monad.html#e_subst"><span class="hs-identifier hs-var hs-var">e_subst</span></a></span><span> </span><span class="annot"><span class="annottext">Env
</span><a href="#local-6989586621680956446"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-283"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">e_expansions :: IdEnv DIdSet
</span><a href="GHC.Stg.Lift.Monad.html#e_expansions"><span class="hs-identifier hs-var">e_expansions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdEnv DIdSet -&gt; Id -&gt; DIdSet -&gt; IdEnv DIdSet
forall a. VarEnv a -&gt; Id -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Env -&gt; IdEnv DIdSet
</span><a href="GHC.Stg.Lift.Monad.html#e_expansions"><span class="hs-identifier hs-var hs-var">e_expansions</span></a></span><span> </span><span class="annot"><span class="annottext">Env
</span><a href="#local-6989586621680956446"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956461"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956462"><span class="hs-identifier hs-var">abs_ids</span></a></span><span>
</span><span id="line-284"></span><span>      </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LiftM a -&gt; RWST Env (OrdList FloatLang) () UniqSM a
forall a. LiftM a -&gt; RWST Env (OrdList FloatLang) () UniqSM a
</span><a href="GHC.Stg.Lift.Monad.html#unwrapLiftM"><span class="hs-identifier hs-var hs-var">unwrapLiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; LiftM a
</span><a href="#local-6989586621680956460"><span class="hs-identifier hs-var">inner</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956451"><span class="hs-identifier hs-var">bndr'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="hs-comment">-- | See 'withLiftedBndr'.</span><span>
</span><span id="line-288"></span><span id="local-6989586621680956762"><span id="local-6989586621680956763"><span class="annot"><a href="GHC.Stg.Lift.Monad.html#withLiftedBndrs"><span class="hs-identifier hs-type">withLiftedBndrs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">Traversable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956763"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680956763"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680956763"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956762"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680956762"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-289"></span><span id="withLiftedBndrs"><span class="annot"><span class="annottext">withLiftedBndrs :: forall (f :: * -&gt; *) a.
Traversable f =&gt;
DIdSet -&gt; f Id -&gt; (f Id -&gt; LiftM a) -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#withLiftedBndrs"><span class="hs-identifier hs-var hs-var">withLiftedBndrs</span></a></span></span><span> </span><span id="local-6989586621680956439"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956439"><span class="hs-identifier hs-var">abs_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ContT a LiftM (f Id) -&gt; (f Id -&gt; LiftM a) -&gt; LiftM a
forall {k} (r :: k) (m :: k -&gt; *) a.
ContT r m a -&gt; (a -&gt; m r) -&gt; m r
</span><a href="../../transformers/src/Control.Monad.Trans.Cont.html#runContT"><span class="hs-identifier hs-var hs-var">runContT</span></a></span><span> </span><span class="annot"><span class="annottext">(ContT a LiftM (f Id) -&gt; (f Id -&gt; LiftM a) -&gt; LiftM a)
-&gt; (f Id -&gt; ContT a LiftM (f Id))
-&gt; f Id
-&gt; (f Id -&gt; LiftM a)
-&gt; LiftM a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Id -&gt; ContT a LiftM Id) -&gt; f Id -&gt; ContT a LiftM (f Id)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Id -&gt; LiftM a) -&gt; LiftM a) -&gt; ContT a LiftM Id
forall {k} (r :: k) (m :: k -&gt; *) a.
((a -&gt; m r) -&gt; m r) -&gt; ContT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Cont.html#ContT"><span class="hs-identifier hs-var">ContT</span></a></span><span> </span><span class="annot"><span class="annottext">(((Id -&gt; LiftM a) -&gt; LiftM a) -&gt; ContT a LiftM Id)
-&gt; (Id -&gt; (Id -&gt; LiftM a) -&gt; LiftM a) -&gt; Id -&gt; ContT a LiftM Id
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; Id -&gt; (Id -&gt; LiftM a) -&gt; LiftM a
forall a. DIdSet -&gt; Id -&gt; (Id -&gt; LiftM a) -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#withLiftedBndr"><span class="hs-identifier hs-var">withLiftedBndr</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956439"><span class="hs-identifier hs-var">abs_ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span class="hs-comment">-- | Substitutes a binder /occurrence/, which was brought in scope earlier by</span><span>
</span><span id="line-292"></span><span class="hs-comment">-- 'withSubstBndr' \/ 'withLiftedBndr'.</span><span>
</span><span id="line-293"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#substOcc"><span class="hs-identifier hs-type">substOcc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-294"></span><span id="substOcc"><span class="annot"><span class="annottext">substOcc :: Id -&gt; LiftM Id
</span><a href="GHC.Stg.Lift.Monad.html#substOcc"><span class="hs-identifier hs-var hs-var">substOcc</span></a></span></span><span> </span><span id="local-6989586621680956438"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956438"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM Id -&gt; LiftM Id
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Env -&gt; Id) -&gt; RWST Env (OrdList FloatLang) () UniqSM Id
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#asks"><span class="hs-identifier hs-var">RWS.asks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; Id -&gt; Subst -&gt; Id
Id -&gt; Subst -&gt; Id
</span><a href="GHC.Stg.Subst.html#lookupIdSubst"><span class="hs-identifier hs-var">lookupIdSubst</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956438"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">(Subst -&gt; Id) -&gt; (Env -&gt; Subst) -&gt; Env -&gt; Id
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Env -&gt; Subst
</span><a href="GHC.Stg.Lift.Monad.html#e_subst"><span class="hs-identifier hs-var hs-var">e_subst</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-295"></span><span>
</span><span id="line-296"></span><span class="hs-comment">-- | Whether the given binding was decided to be lambda lifted.</span><span>
</span><span id="line-297"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#isLifted"><span class="hs-identifier hs-type">isLifted</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#InId"><span class="hs-identifier hs-type">InId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-298"></span><span id="isLifted"><span class="annot"><span class="annottext">isLifted :: Id -&gt; LiftM Bool
</span><a href="GHC.Stg.Lift.Monad.html#isLifted"><span class="hs-identifier hs-var hs-var">isLifted</span></a></span></span><span> </span><span id="local-6989586621680956435"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956435"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM Bool -&gt; LiftM Bool
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Env -&gt; Bool) -&gt; RWST Env (OrdList FloatLang) () UniqSM Bool
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#asks"><span class="hs-identifier hs-var">RWS.asks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; IdEnv DIdSet -&gt; Bool
forall a. Id -&gt; VarEnv a -&gt; Bool
</span><a href="GHC.Types.Var.Env.html#elemVarEnv"><span class="hs-identifier hs-var">elemVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956435"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">(IdEnv DIdSet -&gt; Bool) -&gt; (Env -&gt; IdEnv DIdSet) -&gt; Env -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Env -&gt; IdEnv DIdSet
</span><a href="GHC.Stg.Lift.Monad.html#e_expansions"><span class="hs-identifier hs-var hs-var">e_expansions</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span class="hs-comment">-- | Returns an empty list for a binding that was not lifted and the list of all</span><span>
</span><span id="line-301"></span><span class="hs-comment">-- local variables the binding abstracts over (so, exactly the additional</span><span>
</span><span id="line-302"></span><span class="hs-comment">-- arguments at adjusted call sites) otherwise.</span><span>
</span><span id="line-303"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#formerFreeVars"><span class="hs-identifier hs-type">formerFreeVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#InId"><span class="hs-identifier hs-type">InId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#OutId"><span class="hs-identifier hs-type">OutId</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-304"></span><span id="formerFreeVars"><span class="annot"><span class="annottext">formerFreeVars :: Id -&gt; LiftM [Id]
</span><a href="GHC.Stg.Lift.Monad.html#formerFreeVars"><span class="hs-identifier hs-var hs-var">formerFreeVars</span></a></span></span><span> </span><span id="local-6989586621680956433"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956433"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM [Id] -&gt; LiftM [Id]
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="annot"><span class="annottext">(RWST Env (OrdList FloatLang) () UniqSM [Id] -&gt; LiftM [Id])
-&gt; RWST Env (OrdList FloatLang) () UniqSM [Id] -&gt; LiftM [Id]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-305"></span><span>  </span><span id="local-6989586621680956432"><span class="annot"><span class="annottext">IdEnv DIdSet
</span><a href="#local-6989586621680956432"><span class="hs-identifier hs-var">expansions</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Env -&gt; IdEnv DIdSet)
-&gt; RWST Env (OrdList FloatLang) () UniqSM (IdEnv DIdSet)
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#asks"><span class="hs-identifier hs-var">RWS.asks</span></a></span><span> </span><span class="annot"><span class="annottext">Env -&gt; IdEnv DIdSet
</span><a href="GHC.Stg.Lift.Monad.html#e_expansions"><span class="hs-identifier hs-var hs-var">e_expansions</span></a></span><span>
</span><span id="line-306"></span><span>  </span><span class="annot"><span class="annottext">[Id] -&gt; RWST Env (OrdList FloatLang) () UniqSM [Id]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">([Id] -&gt; RWST Env (OrdList FloatLang) () UniqSM [Id])
-&gt; [Id] -&gt; RWST Env (OrdList FloatLang) () UniqSM [Id]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IdEnv DIdSet -&gt; Id -&gt; Maybe DIdSet
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">IdEnv DIdSet
</span><a href="#local-6989586621680956432"><span class="hs-identifier hs-var">expansions</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956433"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-307"></span><span>    </span><span class="annot"><span class="annottext">Maybe DIdSet
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-308"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680956430"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956430"><span class="hs-identifier hs-var">fvs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; [Id]
</span><a href="GHC.Types.Var.Set.html#dVarSetElems"><span class="hs-identifier hs-var">dVarSetElems</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956430"><span class="hs-identifier hs-var">fvs</span></a></span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span class="hs-comment">-- | Creates an /expander function/ for the current set of lifted binders.</span><span>
</span><span id="line-311"></span><span class="hs-comment">-- This expander function will replace any 'InId' by their corresponding 'OutId'</span><span>
</span><span id="line-312"></span><span class="hs-comment">-- and, in addition, will expand any lifted binders by the former free variables</span><span>
</span><span id="line-313"></span><span class="hs-comment">-- it abstracts over.</span><span>
</span><span id="line-314"></span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#liftedIdsExpander"><span class="hs-identifier hs-type">liftedIdsExpander</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-type">LiftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DIdSet"><span class="hs-identifier hs-type">DIdSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-315"></span><span id="liftedIdsExpander"><span class="annot"><span class="annottext">liftedIdsExpander :: LiftM (DIdSet -&gt; DIdSet)
</span><a href="GHC.Stg.Lift.Monad.html#liftedIdsExpander"><span class="hs-identifier hs-var hs-var">liftedIdsExpander</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RWST Env (OrdList FloatLang) () UniqSM (DIdSet -&gt; DIdSet)
-&gt; LiftM (DIdSet -&gt; DIdSet)
forall a. RWST Env (OrdList FloatLang) () UniqSM a -&gt; LiftM a
</span><a href="GHC.Stg.Lift.Monad.html#LiftM"><span class="hs-identifier hs-var">LiftM</span></a></span><span> </span><span class="annot"><span class="annottext">(RWST Env (OrdList FloatLang) () UniqSM (DIdSet -&gt; DIdSet)
 -&gt; LiftM (DIdSet -&gt; DIdSet))
-&gt; RWST Env (OrdList FloatLang) () UniqSM (DIdSet -&gt; DIdSet)
-&gt; LiftM (DIdSet -&gt; DIdSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-316"></span><span>  </span><span id="local-6989586621680956429"><span class="annot"><span class="annottext">IdEnv DIdSet
</span><a href="#local-6989586621680956429"><span class="hs-identifier hs-var">expansions</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Env -&gt; IdEnv DIdSet)
-&gt; RWST Env (OrdList FloatLang) () UniqSM (IdEnv DIdSet)
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#asks"><span class="hs-identifier hs-var">RWS.asks</span></a></span><span> </span><span class="annot"><span class="annottext">Env -&gt; IdEnv DIdSet
</span><a href="GHC.Stg.Lift.Monad.html#e_expansions"><span class="hs-identifier hs-var hs-var">e_expansions</span></a></span><span>
</span><span id="line-317"></span><span>  </span><span id="local-6989586621680956428"><span class="annot"><span class="annottext">Subst
</span><a href="#local-6989586621680956428"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Env -&gt; Subst) -&gt; RWST Env (OrdList FloatLang) () UniqSM Subst
forall w (m :: * -&gt; *) r a s.
(Monoid w, Monad m) =&gt;
(r -&gt; a) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#asks"><span class="hs-identifier hs-var">RWS.asks</span></a></span><span> </span><span class="annot"><span class="annottext">Env -&gt; Subst
</span><a href="GHC.Stg.Lift.Monad.html#e_subst"><span class="hs-identifier hs-var hs-var">e_subst</span></a></span><span>
</span><span id="line-318"></span><span>  </span><span class="hs-comment">-- We use @noWarnLookupIdSubst@ here in order to suppress &quot;not in scope&quot;</span><span>
</span><span id="line-319"></span><span>  </span><span class="hs-comment">-- warnings generated by 'lookupIdSubst' due to local bindings within RHS.</span><span>
</span><span id="line-320"></span><span>  </span><span class="hs-comment">-- These are not in the InScopeSet of @subst@ and extending the InScopeSet in</span><span>
</span><span id="line-321"></span><span>  </span><span class="hs-comment">-- @goodToLift@/@closureGrowth@ before passing it on to @expander@ is too much</span><span>
</span><span id="line-322"></span><span>  </span><span class="hs-comment">-- trouble.</span><span>
</span><span id="line-323"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680956427"><span class="annot"><span class="annottext">go :: DIdSet -&gt; Id -&gt; DIdSet
</span><a href="#local-6989586621680956427"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680956426"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956426"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621680956425"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956425"><span class="hs-identifier hs-var">fv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IdEnv DIdSet -&gt; Id -&gt; Maybe DIdSet
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">IdEnv DIdSet
</span><a href="#local-6989586621680956429"><span class="hs-identifier hs-var">expansions</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956425"><span class="hs-identifier hs-var">fv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-324"></span><span>        </span><span class="annot"><span class="annottext">Maybe DIdSet
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; Id -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#extendDVarSet"><span class="hs-identifier hs-var">extendDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956426"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; Id -&gt; Subst -&gt; Id
Id -&gt; Subst -&gt; Id
</span><a href="GHC.Stg.Subst.html#noWarnLookupIdSubst"><span class="hs-identifier hs-var">noWarnLookupIdSubst</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680956425"><span class="hs-identifier hs-var">fv</span></a></span><span> </span><span class="annot"><span class="annottext">Subst
</span><a href="#local-6989586621680956428"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Not lifted</span><span>
</span><span id="line-325"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680956422"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956422"><span class="hs-identifier hs-var">fvs'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; DIdSet -&gt; DIdSet
</span><a href="GHC.Types.Var.Set.html#unionDVarSet"><span class="hs-identifier hs-var">unionDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956426"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956422"><span class="hs-identifier hs-var">fvs'</span></a></span><span>
</span><span id="line-326"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680956420"><span class="annot"><span class="annottext">expander :: DIdSet -&gt; DIdSet
</span><a href="#local-6989586621680956420"><span class="hs-identifier hs-var hs-var">expander</span></a></span></span><span> </span><span id="local-6989586621680956419"><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956419"><span class="hs-identifier hs-var">fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DIdSet -&gt; Id -&gt; DIdSet) -&gt; DIdSet -&gt; [Id] -&gt; DIdSet
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; Id -&gt; DIdSet
</span><a href="#local-6989586621680956427"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="GHC.Types.Var.Set.html#emptyDVarSet"><span class="hs-identifier hs-var">emptyDVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DIdSet -&gt; [Id]
</span><a href="GHC.Types.Var.Set.html#dVarSetElems"><span class="hs-identifier hs-var">dVarSetElems</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet
</span><a href="#local-6989586621680956419"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-327"></span><span>  </span><span class="annot"><span class="annottext">(DIdSet -&gt; DIdSet)
-&gt; RWST Env (OrdList FloatLang) () UniqSM (DIdSet -&gt; DIdSet)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">DIdSet -&gt; DIdSet
</span><a href="#local-6989586621680956420"><span class="hs-identifier hs-var">expander</span></a></span><span>
</span><span id="line-328"></span></pre></body></html>